package sy6.servlet;

import javafx.scene.shape.Circle;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class CircleServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String s=request.getParameter("circle");
        Circle circle=new Circle();
        Double r=Double.parseDouble(s);
        circle.setRadius(r);
        PrintWriter out=response.getWriter();
        out.println("圆面积是："+circle);
    }
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doGet(req, resp);
    }
}
